package com.lifeverse.entity.enums;

/**
 * 权限类型枚举
 */
public enum PermissionType {
    
    /**
     * 菜单权限
     */
    MENU("菜单权限"),
    
    /**
     * 按钮权限
     */
    BUTTON("按钮权限"),
    
    /**
     * API权限
     */
    API("API权限"),
    
    /**
     * 数据权限
     */
    DATA("数据权限"),
    
    /**
     * 功能权限
     */
    FUNCTION("功能权限"),
    
    /**
     * 系统权限
     */
    SYSTEM("系统权限");
    
    private final String description;
    
    PermissionType(String description) {
        this.description = description;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 判断是否为UI权限
     */
    public boolean isUiPermission() {
        return this == MENU || this == BUTTON;
    }
    
    /**
     * 判断是否为后端权限
     */
    public boolean isBackendPermission() {
        return this == API || this == DATA || this == FUNCTION;
    }
    
    /**
     * 判断是否为系统级权限
     */
    public boolean isSystemPermission() {
        return this == SYSTEM;
    }
}